#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    int num = 3 * n;
    vector<int> averge (num);
    int len = averge.size();
    
    for(int i = 0; i < len; ++i){
        /*int temp;
        scanf("%d",&temp);
        averge.push_back(temp);*/
        scanf("%d",&averge[i]);
    }
    sort(averge.begin(), averge.end());  //对数组进行排序
    long ret = 0;   
    //从倒数第二大的数开始，每隔一个数为每组中的平均值
    for(int i = len - 2, j = 0; j < n; j++){
        ret += (long)averge[i];
        i -= 2;
    }
    printf("%ld",ret);
    return 0;
}